/* eslint-disable @typescript-eslint/no-explicit-any */
import {
  IEditorContainerController,
  IEditorProvider,
} from '@ibiz-template/runtime';
import { IDropDownList } from '@ibiz/model-core';
import { TreePickerController } from './tree-picker.controller';

/**
 * 树选择编辑器适配器
 *
 * @export
 * @class DropDownListEditorProvider
 * @implements {EditorProvider}
 */
export class TreePickerEditorProvider implements IEditorProvider {
  formEditor: string = 'IBizTreePicker';

  gridEditor: string = 'IBizTreePicker';

  async createController(
    editorModel: IDropDownList,
    parentController: IEditorContainerController,
  ): Promise<TreePickerController> {
    const c = new TreePickerController(editorModel, parentController);
    await c.init();
    return c;
  }
}
